package com.edu.his.controller.login;

import com.edu.his.domain.Employee;
import com.edu.his.domain.Prescription;
import com.edu.his.service.DrugInfoService;
import com.edu.his.service.EmployeeService;
import com.edu.his.service.PrescriptionService;
import com.edu.his.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.net.Proxy;

/**
 * 描述：
 * 创建人：飘
 * 创建时间：2024/12/16
 **/
@RestController
@RequestMapping("/druginfo")
@CrossOrigin(value = "*",maxAge = 3600)
public class DrugInfoController {
    @Autowired
    private DrugInfoService drugInfoService;

    @GetMapping("/selectbyregisterid/{registerId}")
    public R selectByRegisterId(@PathVariable("registerId") Integer registerId) throws InterruptedException {
        //Thread.sleep(2000);
        return this.drugInfoService.selectByRegisterId(registerId);
    }

    @PostMapping("/updatestate")
    public R updateState(@RequestBody Prescription prescription) {

        return this.drugInfoService.updateState(prescription);
    }
}
